<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('客户管理列表')" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>联系人：</label>
                                <input type="text" name="clientName"/>
                            </li>
                            <li>
                                <label>电话：</label>
                                <input type="text" name="mobile"/>
                            </li>
                            <li>
                                <label>QQ号码：</label>
                                <input type="text" name="QQ"/>
                            </li>
                            <li>
                                <label>微信：</label>
                                <input type="text" name="wechat"/>
                            </li>
                            <li>
                                <label>微博：</label>
                                <input type="text" name="weibo"/>
                            </li>
                            <li>
                                <label>收款人：</label>
                                <input type="text" name="payee"/>
                            </li>
                            <li>
                                <label>银行：</label>
                                <select class="form-control" name="bankName" th:with="type=${@dict.getType('work_bank')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>开户行：</label>
                                <input type="text" name="bankDeposit"/>
                            </li>
                            <li>
                                <label>银行账号：</label>
                                <input type="text" name="bankAccount"/>
                            </li>

                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasAnyPermissions="work:client:add,work:appclient:add,work:networkclient:add,work:wechatclient:add,work:weiboclient:add,work:flowclient:add,work:planeclient:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasAnyPermissions="work:client:edit,work:appclient:edit,work:networkclient:edit,work:wechatclient:edit,work:weiboclient:edit,work:flowclient:edit,work:planeclient:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasAnyPermissions="work:client:remove,work:appclient:remove,work:networkclient:remove,work:wechatclient:remove,work:weiboclient:remove,work:flowclient:remove,work:planeclient:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasAnyPermissions="work:client:export,work:appclient:export,work:networkclient:export,work:wechatclient:export,work:weiboclient:export,work:flowclient:export,work:planeclient:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: select2-js" />
     <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('work:client:edit')}]];
        var removeFlag = [[${@permission.hasPermi('work:client:remove')}]];
        var prefix = ctx + "work/client";
        var work_bank = [[${@dict.getType('work_bank')}]];
        var path = window.location.pathname.split("/")[2].toLowerCase()
        var clientType= {
            networkclient:"1",
            weiboclient:"2",
            wechatclient:"3",
            planeclient:"4",
            appclient:"5",
            flowclient:"6"
        };

        $(function() {
            var options = {
                url: prefix + "/list/"+clientType[path],
                createUrl: prefix + "/add/"+clientType[path],
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export/"+clientType[path],
                modalName: "客户管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'clientId',
                    title: '客户ID'

                },

                {
                    field: 'clientName',
                    title: '联系人'
                },
                {
                    field: 'mobile',
                    title: '电话'
                },
                {
                    field: 'QQ',
                    title: 'QQ号码'
                },
                {
                    field: 'wechat',
                    title: '微信'
                },
                {
                    field: 'weibo',
                    title: '微博'
                },
                {
                    field: 'payee',
                    title: '收款人'
                },
                {
                    field: 'bankName',
                    title: '银行',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(work_bank, value);
                    }
                },
                {
                    field: 'bankDeposit',
                    title: '开户行'
                },
                {
                    field: 'bankAccount',
                    title: '银行账号'
                },
                {
                    field: 'province',
                    title: '省份'
                },
                {
                    field: 'city',
                    title: '地市'
                },
                {
                    field: 'remark',
                    title: '备注'
                }]
            };
            $.table.init(options);


        });
    </script>
</body>
</html>